MonitorTag = function(tag){
	this.tag = tag;
	this.web = {};
};

MonitorTag.prototype = {
	
	/* 设置页面配置信息 */
	setWeb:function(web){
		this.web = web;
		
		//布局默认值
		if(this.web.layout == undefined){
			this.web.layout = [12];
		}
		
		//图标默认值
		if(this.web.ico == undefined){
			this.web.ico = ["fa fa-thumbs-up"];
		}
		
		//颜色默认值
		if(this.web.color == undefined){
			this.web.color = ["#000000"];
		}
		
		//DIV标示
		if(this.web.divId == undefined){
			this.web.divId = "tag_div";
		}
		
	},

	/* 页面装载 */
	load:function(){
		this.remove();
		this.loadTag();
	},
	
	/* 移除页面信息 */
	remove:function(){
		$('#'+this.web.divId+" div").remove();
	},	
	
	/* 装载组件信息 */
	loadTag:function(){
		$('#'+this.web.divId).append(this.getDivAll());
	},
	
	/* 刷新页面 */
	refresh:function(){
		this.load();
	},
	
	/* 获取所有DIV信息 */
	getDivAll:function(){
		var div = "";
		for(var i=0;i<this.tag.length;i++){
			div += this.getDiv(i);
		}	
		div += '<div class="clearfix"></div>';
		return div;
	},
	
	/* 获取某索引DIV信息 */
	getDiv:function(idx){
		var div = "";
		
		div += "<div class='col-md-4'>";
		div += "<div class='widget widget1'>";
		div += "<div class='r3_counter_box'>";
		
		div += '<i class="pull-left '
			+ this.web.ico[idx % this.web.ico.length]
			+' icon-rounded" style="background-color:'
			+ this.web.color[idx % this.web.color.length]
			+';"></i>';
		
		div += '<div class="stats">';		
		div += "<h5><strong>"+this.tag[idx].data+"</strong></h5>";
		div += "<span>"+this.tag[idx].lable+"</span>";
		div += '</div>';
		
		div += "</div>";
		div += "</div>";
		div += "</div>";
		
		return div;
		
	}

	

};